package org.example.entity;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @TableName grade
 */
public class Grade implements Serializable {
    /**
     * 
     */
    private Integer gid;

    /**
     * 
     */
    private String gname;
    private List<Student> students;

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getGid() {
        return gid;
    }

    /**
     * 
     */
    public void setGid(Integer gid) {
        this.gid = gid;
    }

    /**
     * 
     */
    public String getGname() {
        return gname;
    }

    /**
     * 
     */
    public void setGname(String gname) {
        this.gname = gname;
    }

    public List<Student> getStudents() {
        return students;
    }

    public void setStudents(List<Student> students) {
        this.students = students;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Grade other = (Grade) that;
        return (this.getGid() == null ? other.getGid() == null : this.getGid().equals(other.getGid()))
            && (this.getGname() == null ? other.getGname() == null : this.getGname().equals(other.getGname()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getGid() == null) ? 0 : getGid().hashCode());
        result = prime * result + ((getGname() == null) ? 0 : getGname().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", gid=").append(gid);
        sb.append(", gname=").append(gname);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}